<%@page import="tx.bjdacp.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title><%=DrugSellUnitPrepare.TABLE_ALIAS%> 维护</title>

	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>

	<script type="text/javascript" >
		$(document).ready(function() {
			// 分页需要依赖的初始化动作
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
<s:bean name="tx.bjdacp.service.ZoneManager" var="zoneManager" ></s:bean>
	<form id="queryForm" name="queryForm" action="<c:url value="/pages/DrugSellUnitPrepare/list.do"/>" method="post" style="display: inline;">
	<div class="queryPanel">
		<fieldset>
			<legend>搜索</legend>
			<table>
				<tr>
					<td class="tdLabel">所在镇</td>
					<td>
					<s:select   list="#zoneManager.findAll()"
				                key="zoneId" theme="simple" headerKey=""  headerValue="请选择..." listValue="zoneName" listKey="zoneId"/>

					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_ACCEPT_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.acceptDateBegin}' pattern='<%=DrugSellUnitPrepare.FORMAT_ACCEPT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnitPrepare.FORMAT_ACCEPT_DATE%>'})" id="acceptDateBegin" name="acceptDateBegin"   />
						<input value="<fmt:formatDate value='${query.acceptDateEnd}' pattern='<%=DrugSellUnitPrepare.FORMAT_ACCEPT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnitPrepare.FORMAT_ACCEPT_DATE%>'})" id="acceptDateEnd" name="acceptDateEnd"   />
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_APPLY_PERSON%></td>
					<td>
						<input value="${query.applyPerson}" id="applyPerson" name="applyPerson" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_ACCEPT_CODE%></td>
					<td>
						<input value="${query.acceptCode}" id="acceptCode" name="acceptCode" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>

					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_APPLY_ADDRESS%></td>
					<td>
						<input value="${query.applyAddress}" id="applyAddress" name="applyAddress" maxlength="500"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_MEASURE_RESULT%></td>
					<td>
						<input value="${query.measureResult}" id="measureResult" name="measureResult" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_MEASURE_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.measureDateBegin}' pattern='<%=DrugSellUnitPrepare.FORMAT_MEASURE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnitPrepare.FORMAT_MEASURE_DATE%>'})" id="measureDateBegin" name="measureDateBegin"   />
						<input value="<fmt:formatDate value='${query.measureDateEnd}' pattern='<%=DrugSellUnitPrepare.FORMAT_MEASURE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnitPrepare.FORMAT_MEASURE_DATE%>'})" id="measureDateEnd" name="measureDateEnd"   />
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_TIME_LIMIT%></td>
					<td>
						<input value="${query.timeLimit}" id="timeLimit" name="timeLimit" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_PHONE%></td>
					<td>
						<input value="${query.phone}" id="phone" name="phone" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_ACCREDITED_PERSON%></td>
					<td>
						<input value="${query.accreditedPerson}" id="accreditedPerson" name="accreditedPerson" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnitPrepare.ALIAS_REMARK%></td>
					<td>
						<input value="${query.remark}" id="remark" name="remark" maxlength="1000"  class=""/>
					</td>
				</tr>
			</table>
		</fieldset>
		<div class="handleControl">
			<input type="submit" class="stdButton" style="width:80px" value="查询" onclick="getReferenceForm(this).action='${ctx}/pages/DrugSellUnitPrepare/list.do'"/>
			<input type="submit" class="stdButton" style="width:80px" value="新增" onclick="getReferenceForm(this).action='${ctx}/pages/DrugSellUnitPrepare/create.do'"/>
			<input type="button" class="stdButton" style="width:80px" value="删除" onclick="batchDelete('${ctx}/pages/DrugSellUnitPrepare/delete.do','items',document.forms.queryForm)"/>
		<div>
	</div>

	<div class="gridTable">

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>

		<table width="100%"  border="0" cellspacing="0" class="gridBody">
		  <thead>

			  <tr>
				<th style="width:1px;"> </th>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>

				<!-- 排序时为th增加sortColumn即可,new SimpleTable('sortColumns')会为tableHeader自动增加排序功能; -->
				<th sortColumn="accept_date" ><%=DrugSellUnitPrepare.ALIAS_ACCEPT_DATE%></th>
				<th sortColumn="apply_person" ><%=DrugSellUnitPrepare.ALIAS_APPLY_PERSON%></th>
				<th sortColumn="accept_code" ><%=DrugSellUnitPrepare.ALIAS_ACCEPT_CODE%></th>
				<th sortColumn="zone_name" ><%=DrugSellUnitPrepare.ALIAS_ZONE_NAME%></th>
				<th sortColumn="apply_address" ><%=DrugSellUnitPrepare.ALIAS_APPLY_ADDRESS%></th>
				<th sortColumn="measure_result" ><%=DrugSellUnitPrepare.ALIAS_MEASURE_RESULT%></th>
				<th sortColumn="measure_date" ><%=DrugSellUnitPrepare.ALIAS_MEASURE_DATE%></th>
				<th sortColumn="time_limit" ><%=DrugSellUnitPrepare.ALIAS_TIME_LIMIT%></th>
				<th sortColumn="phone" ><%=DrugSellUnitPrepare.ALIAS_PHONE%></th>
				<th sortColumn="accredited_person" ><%=DrugSellUnitPrepare.ALIAS_ACCREDITED_PERSON%></th>
				<th sortColumn="remark" ><%=DrugSellUnitPrepare.ALIAS_REMARK%></th>

				<th>操作</th>
			  </tr>

		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">

			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td>${page.thisPageFirstElementNumber + status.index}</td>
				<td><input type="checkbox" name="items" value="drugSellUnitPrepareId=${item.drugSellUnitPrepareId}&"></td>

				<td><c:out value='${item.acceptDateString}'/>&nbsp;</td>
				<td><c:out value='${item.applyPerson}'/>&nbsp;</td>
				<td><c:out value='${item.acceptCode}'/>&nbsp;</td>
				<td><c:out value='${item.zone.zoneName}'/>&nbsp;</td>
				<td><c:out value='${item.applyAddress}'/>&nbsp;</td>
				<td><c:out value='${item.measureResult}'/>&nbsp;</td>
				<td><c:out value='${item.measureDateString}'/>&nbsp;</td>
				<td><c:out value='${item.timeLimit}'/>&nbsp;</td>
				<td><c:out value='${item.phone}'/>&nbsp;</td>
				<td><c:out value='${item.accreditedPerson}'/>&nbsp;</td>
				<td><c:out value='${item.remark}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/pages/DrugSellUnitPrepare/show.do?drugSellUnitPrepareId=${item.drugSellUnitPrepareId}&">查看</a>&nbsp;&nbsp;&nbsp;
					<a href="${ctx}/pages/DrugSellUnitPrepare/edit.do?drugSellUnitPrepareId=${item.drugSellUnitPrepareId}&">修改</a>
				</td>
			  </tr>

		  	  </c:forEach>
		  </tbody>
		</table>

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
	</div>
	</form>
</rapid:override>

<%-- jsp模板继承,具体使用请查看: http://code.google.com/p/rapid-framework/wiki/rapid_jsp_extends --%>
<%@ include file="base.jsp" %>

